﻿using offline2048;
using UnityEngine;
using UnityEngine.UI;

public class PrizeAnimation : MonoBehaviour
{
    private Animator prize;
    public Sprite m_StoneSprite;
    public Sprite m_DollerSprite;
    public Image m_Image_1;
    public Image m_Image_2;
    public Image m_Image_3;
    public Image m_Image_4;
    public Image m_Image_5;
    private void Start()
    {
        prize = GetComponent<Animator>();
    }

    public void PlayPrizeAnimation()
    {
        if (UserLayerManager.Instance.IsOrganic() || UserLayerManager.Instance.GetCurrentUserLayer() == UserLayerManager.UserLayerType.None)
        {
            m_Image_1.sprite = m_StoneSprite;
            m_Image_2.sprite = m_StoneSprite;
            m_Image_3.sprite = m_StoneSprite;
            m_Image_4.sprite = m_StoneSprite;
            m_Image_5.sprite = m_StoneSprite;
        }
        else
        {
            m_Image_1.sprite = m_DollerSprite;
            m_Image_2.sprite = m_DollerSprite;
            m_Image_3.sprite = m_DollerSprite;
            m_Image_4.sprite = m_DollerSprite;
            m_Image_5.sprite = m_DollerSprite;
        }
        AudioController.Play("Prize");
        prize.SetTrigger("Animation");
    }

    public void PlayCoinSound()
    {
        AudioController.Play("Knock");
    }
}
